-module(gp_data).
-compile(export_all).
-include("gp_struct.hrl").

lay_data() ->
    dict:from_list(
      [{metr,
	#terr{name="Metropolitan France",
	      layers=dict:from_list([{ortho,
				      #lay{name="Aerial Photo",
					   id="UxG",
					   x1=-478568,
					   y1=4549360,
					   x2=832524,
					   y2=5726706,
					   x=179712,
					   y=5439163,
					   smin=4,
					   smax=17,
					   format="jpg"
					  }},
				     {scan,
				      #lay{name="IGN Maps",
					   id="8u6",
					   x1=-478568,
					   y1=4549360,
					   x2=832524,
					   y2=5726706,
					   x=179712,
					   y=5439163,
					   smin=6,
					   smax=17,
					   format="jpg"}}
				    ]),
	      ratios=[{0.199660570975744,0.199660570975744},
		      {9.98302854878722e-002,9.98302854878722e-002},
		      {4.99151427439361e-002,4.99151427439361e-002},
		      {1.99660579761807e-002,1.99660579761807e-002},
		      {9.98302898809033e-003,9.98302898809033e-003},
		      {3.99363420481952e-003,3.99363420481952e-003},
		      {1.99681710240976e-003,1.99681710240976e-003},
		      {9.98434978032063e-004,9.98434978032063e-004},
		      {7.98743712948635e-004,7.98743712948635e-004},
		      {3.99371856474318e-004,3.99371856474318e-004},
		      {1.99685928237159e-004,1.99685928237159e-004},
		      {9.98347786662634e-005,9.98347786662634e-005},
		      {4.99213533572093e-005,4.99213533572093e-005},
		      {2.49606916938473e-005,2.49606916938473e-005},
		      {1.24803458469237e-005,1.24803458469237e-005},
		      {6.24017292346184e-006,6.24017292346184e-006},
		      {3.12008646173092e-006,3.12008646173092e-006},
		      {1.56004323086546e-006,1.56004323086546e-006},
		      {7.8002161543273e-007,7.8002161543273e-007},
		      {3.90010807716365e-007,3.90010807716365e-007},
		      {1.95005403858182e-007,1.95005403858182e-007},
		      {1.95004214034262e-007,1.95004214034262e-007},
		      {1.95003191791175e-007,1.95003191791175e-007},
		      {1.95002186306171e-007,1.95002186306171e-007}],
	      proj=#proj{type=equirectangular,params={6378137,46.5,3,0,0}}
	     }
       },
       {spm,
	#terr{name="Saint-Pierre-et-Miquelon",
	      layers=dict:from_list([{ortho,
				      #lay{name="Aerial Photo",
					   id="c5N",
					   x1=-4284699,
					   y1=5201357,
					   x2=-4254653,
					   y2=5251758,
					   x=-4265000,
					   y=5207278,
					   smin=4,
					   smax=12,
					   format="jpg"
					  }},
				     {scan,
				      #lay{name="IGN Maps",
					   id="9AU",
					   x1=-4284699,
					   y1=5201357,
					   x2=-4254653,
					   y2=5251758,
					   x=-4265000,
					   y=5207278,
					   smin=6,
					   smax=7,
					   format="jpg"}}
				    ]),
	      ratios=[{0.199660570975744,0.199660570975744},
		      {9.98302854878722e-002,9.98302854878722e-002},
		      {4.99151427439361e-002,4.99151427439361e-002},
		      {1.99660579761807e-002,1.99660579761807e-002},
		      {9.98302898809033e-003,9.98302898809033e-003},
		      {3.99363420481952e-003,3.99363420481952e-003},
		      {1.99681710240976e-003,1.99681710240976e-003},
		      {9.98434978032063e-004,9.98434978032063e-004},
		      {7.98743712948635e-004,7.98743712948635e-004},
		      {3.99371856474318e-004,3.99371856474318e-004},
		      {1.99685928237159e-004,1.99685928237159e-004},
		      {9.98347786662634e-005,9.98347786662634e-005},
		      {4.99213533572093e-005,4.99213533572093e-005},
		      {2.49606916938473e-005,2.49606916938473e-005},
		      {1.24803458469237e-005,1.24803458469237e-005},
		      {6.24017292346184e-006,6.24017292346184e-006},
		      {3.12008646173092e-006,3.12008646173092e-006},
		      {1.56004323086546e-006,1.56004323086546e-006},
		      {7.8002161543273e-007,7.8002161543273e-007},
		      {3.90010807716365e-007,3.90010807716365e-007},
		      {1.95005403858182e-007,1.95005403858182e-007},
		      {1.95004214034262e-007,1.95004214034262e-007},
		      {1.95003191791175e-007,1.95003191791175e-007},
		      {1.95002186306171e-007,1.95002186306171e-007}],
	      proj=#proj{type=equirectangular,params={6378137,47,-56,0,0}}
	     }
       }
      ]).

terr_data(Terr) ->
    dict:fetch(Terr,lay_data()).

lay_data(Terr,Lay) ->
    dict:fetch(Lay,(terr_data(Terr))#terr.layers).

image_url_data() ->
    "http://visu-2d.geoportail.fr/geoweb/maps".

localhost_data() ->
    "http://localhost:8000".

crypt_data() ->
    dict:from_list([{sign,["2","A","9","r"]},
		    {nbr,["x","G","3","r","8","k","T","Q","m","Y","I","c","j","K","M","7","W","b","2","q","t","L","H","9","f"]},
		    {xy,["X","u","P","4","N","G","Z","8","n","g","I","c","j","K","M","7","W","Q","T","b","2","q","C","1","e","h","O","o","t","L","H","9","z","s","m","a","w","J","S","Y","l","A","i","f","U","v","y","r","k","E","D","x","3","6","5","F","p","0","V","R","d","B"]}
		   ]).

crypt_data(Crypt) ->
    dict:fetch(Crypt,crypt_data()).

